// ============================== 导入依赖 ============================== //

import CORE from '@/CORE'
import Client from '@api/parking/api/ParkParkApi'

import OneClass from '@api/parking/model/ParkReq'

const CLIENT = CORE.grpcCLIENT(Client)

// ============================== 导出远程接口 ============================== //

export default {
  // —————————————————————————————— 单项 —————————————————————————————— //

  transInfoParam(infoParam, { rootState: { map: { param } } }) {
    return param
  },
  async getInfo(param, TIP = '查询实时监控') {
    const DTO = CORE.grpcDTO(OneClass, param)
    const resp = await CORE.grpc(TIP, CLIENT, 'queryParkDetail', DTO)
    return resp || {}
  },
  transInfo({ parkDto = {}, entranceDto = [] }) {
    const videoList = parkDto.videoDevice || []
    entranceDto.forEach((item) => {
      videoList.push(...(item.videoDevice || []))
    })
    return { videoList }
  },
}
